Skip to content

fix(ui): the entry form draws a group-placed master-detail table at its field group - #36009

Merged
os-zhuang merged 11 commits into
mainfrom
claude/project-thread-3lahxp
Nov 21, 2026
Merged

os-zhuang merged 11 commits into
mainfrom
claude/project-thread-3lahxp

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Sales · project thread

repo:objectstack#1 · os-sales · session_01L6bhgXUMw7b8gUmNsyoXHR

Fixes #35889

Slice S2 of #35889 (S1 = #35921, merged as f3c9d42). Claim 7057842463. Area b1-R2.

维护者速读

  • 用户看到的变化:主对象的字段分组指定了主从子表(例如报销单的「Expense Lines」分组排在「Report」和「Totals」之间)时,新建和编辑表单里这张明细表现在就出现在这个分组的位置,和记录页一致;以前(S1)它总是排在所有字段的最下面。
  • 分组导航条:表单顶部按分组跳转的导航条,现在也在明细表这一站停(例如 Report / Expense Lines / Totals)。
  • 分页签表单:明细表在分组的位置单独成一个页签,页签名用分组的名字。向导表单:主从向导本来就按简单表单画,跟简单表单一样放到分组位置。
  • 不变的:没有分组指定的子表(表单视图自己写的 subforms)、以及 sections 跟字段分组对不上的表单,明细表照旧在最下面;主记录和明细一次保存、合计在表单底部、展开一行的编辑框跟着明细表走。不改任何元数据写法。
  • 本 PR 收尾 主从子表默认只是页签,不再自动放进概览和表单;只有字段分组指定时才放进去 #35889(Fixes)。

What changes

A master-detail collection that a field group of the parent places (fieldGroups[].relatedList) is now drawn at that group in the parent's create and edit forms, where the record page draws it, instead of below every field of the record.

  • Form slots (ui/packages/plugin-form/src/formSlots.ts, new). MasterDetailForm hands its header ObjectForm a runtime-only list of its collections (package-local hand-off type, not on the ObjectFormSchema authoring face). placeFormSlots lays them out among the form's sections by the record page's rule (bodyTablePlacement): after the sections of the groups declared before the placing group, before those declared after it; a section that names no declared group (the ungrouped bucket) counts as after every group. A layout none of whose sections names a declared group places nothing.
  • Simple form (ObjectForm.tsx): each placed collection becomes a form-slot row in the one field list, between the sections. The form renderer (ui/packages/components/src/renderers/form/form.tsx) draws that row as an empty full-width element; no new export.
  • The slot's controls are not the header form's: the slot element sits inside the header's <form>, so FormSlotPlacement wraps the portaled collection in a form of its own (noValidate, a disabled hidden default button, submit prevented). The header's requestSubmit() then validates only its own fields (a line cell's bad input never blocks Save with a browser bubble), a line button without a type (the shared Button sets none) never submits the header, and Enter in a line cell submits nothing: the lines behave as they did below the form, owned by no header form. The renderer's reveal of an errored field (fieldWrapper) skips what a host drew into this form's slot rows, while an editor inside a slot still finds its own fields.
  • Section bar: a slot row carries its group's (translated) label, once per group, and the form renderer reports a labelled slot to the host's section navigation (FormSectionNavContext, 分组表单:加分组导航,点一下滚到对应分组,并标出还有必填未填的分组 #34605) between the headings around it, with the slot element as its anchor. An unlabelled slot is no stop.
  • Tabbed form (TabbedForm.tsx): a placed collection is a tab of its own at its group's position, labelled with the group's (translated) label. A master-detail wizard is already drawn as the simple form (ObjectForm's master-detail route), so it places the same way.
  • The collection is drawn by MasterDetailForm into the slot through a portal (FormSlotPlacement, a FormSlotStore per form in a ref), so the lines stay out of the header's React tree: a header keystroke still never re-renders them and they never re-render the header. The header reports which collections its drawn layout claims (never while it is loading), so a collection no layout claims stays in its old place below the fields, and a remounting header (after a create) does not make the lines jump below and back. An expanded row's editor opens in the same slot, beside its collection. The header scrape for the lines' parent.* rules skips the slot's inputs. The document totals stay at the foot of the form.
  • Texts S1 left ("below the record's fields until the form places it at the group"): ObjectFieldGroupSchema.relatedList describe and jsdoc, FieldSchema.relatedList jsdoc, the related-list-body-table.ts header and its describe pin, the regenerated content/docs/references/data/object.mdx, the acceptance line of migration entry semantic/18.master-detail-related-list-tab-by-default, and S1's changeset line. ADR-0035: one add-only note after the third note; S1's sentences are left as written (the note says which one it supersedes).
  • object.form.ts's group help ("The parent's create and edit forms inline the table too …") makes no position claim, so it is unchanged and its bundles are not regenerated.

Why

Card #35889, acceptance line 2: 「同一个对象,加一个指向这张子表的分组并排在第二位:记录页字段区的第二个分组位置出现这张表;新建、编辑表单同一位置出现;页签里仍有它。」 S1 delivered the record page half; this delivers the form half, as agreed in the split.

Verification

Head 97afed5: main merged in after #35984 landed (three keep-both hunks in MasterDetailForm.tsx, nothing else). The reviews below were read at 84dc199. On the merged tree, tsc in plugin-form is clean and the plugin-form + form-renderer suites pass (332 files, 3354 passed / 18 skipped).

  • Form ownership (L1-c should-fix): a DOM pin asserts every control in the slot has a form other than the header's and clicking each line button fires no header submit (red without the wrapper); form-invalid-scroll.test.tsx pins that the reveal of an errored field lands on the form's own field, not a same-named field drawn into a slot (red without the filter). Real browser (owner-check.cjs): 12 slot controls, 0 owned by the header; Enter in a cell and Add line make no header submit and no write; with letters in a line's Amount cell (validity.badInput), Create reaches the app's own check ("Amount is required", bad cells marked) with no browser bubble. Suites after the fix: 331 files, 3343 passed / 18 skipped; tsc clean in plugin-form and components.
  • New pins (13): formSlots.test.ts (placement order, a group declared last, entry reading, nothing placed, slot store), MasterDetailForm.groupPlacement-35889.test.tsx (simple form between the groups around its group, an unplaced collection below the form, placed last, edit mode with loaded lines at the group and drawn once, save batch, tabbed form tab order with the collection in its tab), and one case in form-section-nav-34605.test.tsx (a labelled slot is a section-bar stop between the headings, an unlabelled one is not).
  • Ablation: dropping the placement (the header claims nothing) turns 4 of the DOM pins red; dropping the slot from the section-bar report turns the nav pin red. Restored, green.
  • Suites: vitest run packages/plugin-form packages/components/src/renderers/form 331 files, 3335 passed / 18 skipped; after merging main, FormSectionNav (fix(plugin-form): the grouped dialog section bar is a jump bar, hidden when the sections fit #35988) + ModalForm + the new pins 8 files / 63 passed. packages/spec tests green; check:generated clean after the object.mdx regeneration.
  • Static: tsc --noEmit clean in plugin-form and components; eslint on the changed files 0 errors.
  • Browser (real Console on the showcase expense report, New form; light and dark at 1280 px, light at 375 px):
    • default form: Report section, then the Expense Lines grid inside the form;
    • with a temporary, uncommitted Totals field: Report, Expense Lines, Totals in that order, and the section bar reads Report / Expense Lines / Totals;
    • temporary tabbed form view: tabs Report / Expense Lines / Totals, the grid in the Expense Lines tab;
    • temporary wizard form view: drawn as the simple form, same order.
      All temporary edits were reverted before commit.

Clause-②: no
Metadata-protocol: none

DELIBERATE CORRECTION (pending release note)

Check Changeset is red by design: this PR rewrites one line of a pending release note it did not add, because the behaviour that line describes is the behaviour this PR changes. Restoring it would republish a false sentence.

  • Note: .changeset/35889-master-detail-tab-by-default.md (S1, feat(spec, ui): a master_detail child is a tab by default; a field group puts it in the overview and the form #35921, unreleased).
  • Before: "In the entry form a placed table still sits below the record's fields, where inlineEdit tables sit today. Moving it to its group's place in the form is a follow-up."
  • After: "In the entry form a placed table sits at its group's place too: between the sections of the groups around it, or in a tab of its own (labelled with the group) in a tabbed form. A form whose sections name no field group keeps it below the record's fields."

No other line of that note changes. The seat confirms this through its same-head contract-review record (landing-operations.md).

Follow-ups (not in this PR)

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic.
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes.
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: its generated artifacts are regenerated and committed.
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done.

🤖 Generated with Claude Code

https://claude.ai/code/session_01L6bhgXUMw7b8gUmNsyoXHR

…l table

A slot row carries its field group's label, once per group, and the form
renderer reports a labelled slot to the section navigation between the
headings around it. Adds an edit-mode pin for the placed collection.

Claude-Session: https://claude.ai/code/session_01L6bhgXUMw7b8gUmNsyoXHR
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/l documentation Improvements or additions to documentation protocol:data tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 21, 2026
@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/spec, touching 3 documentable anchor(s). ⚠️ 1 changed file(s) yielded no anchor (packages/spec/src/data/related-list-body-table.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

11 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/concepts/metadata-driven.mdx (via FieldSchema (symbol, a top-level const))
  • content/docs/data-modeling/external-datasources.mdx (via FieldSchema (symbol, a top-level const))
  • content/docs/data-modeling/field-types.mdx (via FieldSchema (symbol, a top-level const))
  • content/docs/data-modeling/validation-rules.mdx (via FieldSchema (symbol, a top-level const))
  • content/docs/deployment/troubleshooting.mdx (via FieldSchema (symbol, a top-level const))
  • content/docs/deployment/validating-metadata.mdx (via FieldSchema (symbol, a top-level const))
  • content/docs/getting-started/quick-reference.mdx (via FieldSchema (symbol, a top-level const))
  • content/docs/kernel/contracts/data-engine.mdx (via FieldSchema (symbol, a top-level const))
  • content/docs/protocol/backward-compatibility.mdx (via FieldSchema (symbol, a top-level const))
  • content/docs/protocol/objectql/types.mdx (via FieldSchema (symbol, a top-level const))
  • content/docs/protocol/objectui/concept.mdx (via FieldSchema (symbol, a top-level const))

⛔ 4 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/v17/17-0.mdx (via FieldSchema (symbol, a top-level const))
  • content/docs/releases/v17/17-1.mdx (via FieldSchema (symbol, a top-level const))
  • content/docs/releases/v18/18-3.mdx (via FieldSchema (symbol, a top-level const))
  • content/docs/releases/v18/18-4.mdx (via FieldSchema (symbol, a top-level const))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see
  • 1 changed file(s) yielded no anchor (packages/spec/src/data/related-list-body-table.ts) — pages documenting those are invisible to this run
  • the SDK route bridge reached 65 of 247 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 123 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 174 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 141a826f4c124187c2a3af253dc5a95f9d3818d7 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 8d69c6f66ff15fa2f612c6c424462db8f0a01c0b — the merge of head 97afed5aab44ab898b1c29ea8429ad056fcdb981 into base 141a826f4c124187c2a3af253dc5a95f9d3818d7, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 8d69c6f66ff15fa2f612c6c424462db8f0a01c0b && git checkout 8d69c6f66ff15fa2f612c6c424462db8f0a01c0b
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 141a826f4c124187c2a3af253dc5a95f9d3818d7 97afed5aab44ab898b1c29ea8429ad056fcdb981 && git checkout -B drift-repro 141a826f4c124187c2a3af253dc5a95f9d3818d7 && git merge --no-ff 97afed5aab44ab898b1c29ea8429ad056fcdb981

node scripts/docs-audit/affected-docs.mjs --json 141a826f4c124187c2a3af253dc5a95f9d3818d7

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 141a826f4c124187c2a3af253dc5a95f9d3818d7 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

… header form

The slot sits inside the header's <form>, so the portaled collection is
wrapped in a form of its own (noValidate, a disabled default button,
submit prevented): the header's requestSubmit validates only its own
fields, a line button without a type no longer submits the header, and
Enter in a line cell submits nothing. The renderer's reveal of an
errored field skips what a host drew into its slot rows.

Claude-Session: https://claude.ai/code/session_01L6bhgXUMw7b8gUmNsyoXHR
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgXtcSJVbw8Gny1ERbP

维护者速读

  • 这一步把明细表在“新建/编辑”表单里的位置改对了:分组放在哪里,明细表就出现在哪里;分页签的表单里,明细表有自己的页签。电脑和手机截图都有,位置看着都对。
  • 我读的时候发现一个隐患:明细表嵌进主表单后,格子里没填完的日期或写错的数字,可能让浏览器自己拦住“保存”。开发线程在新提交里已经改好了:明细表套了一层自己的表单,主表单只检查自己的字段。我核过代码和新增的测试。
  • Check Changeset 红是有意的:这次改写了上一步还没发布的一句发布说明,因为那句话说的行为正是这次改掉的。我核对过,新句子是对的。
  • 要你做什么:现在不需要。合并前还要过席位的 Fable 复审和 os-zhuang 的批准。

席位核对 — ACCEPT (L1-c) · repo:objectstack#1 · head 84dc199e27 · 2026-11-21T07:07Z

Read at 84dc199e27: 18 files against main. It touches docs/adr/** and packages/spec/src/**, so it is Tier H. This is an L1 only: the seat runs the Fable L2 on this head, and os-zhuang approves.

I first read 11ee7b5f1b, then the delta to 84dc199e27. It holds 25b2e82f, the merge of main (9f3f7852, read with --remerge-diff), the reference regeneration (6d0988c0), and 84dc199e, a test-only import that loads @object-ui/react-runtime at collection time.

Found in the read, fixed at 25b2e82f

  • The portal put the line grid inside the header <form>. At 11ee7b5f1b the header's requestSubmit() (no noValidate) would have run native constraint validation over the line cells. A badInput number or date cell could then have stopped Save at a browser bubble, before react-hook-form's onSubmit ran.
  • The fix. FormSlotPlacement now portals the collection inside a wrapper <form noValidate onSubmit={preventDefault}> whose first child is a disabled, hidden default button. So:
    • every line control's form owner is the wrapper, not the header, and the header validates only its own fields;
    • a line button without a type submits only the wrapper, which does nothing;
    • Enter in a cell meets the disabled default button, so implicit submission does nothing.
  • The expanded row editor. It keeps its own <form> as the owner of its inputs. Its React submit bubbles to the wrapper's preventDefault, which is harmless next to react-hook-form's own.
  • Reveal on refusal. form.tsx's fieldWrapper now skips a [data-field] that sits in one of this form's own slot rows. So a header refusal scrolls to the header's field, never to a same-named line-editor field, and an editor inside a slot still finds its own fields.
  • Pins.
    • MasterDetailForm.groupPlacement-35889 asserts control.form !== header for every input, select, textarea and button in the slot, and that clicking every slot button fires no header submit.
    • form-invalid-scroll pins the reveal: the form's own field is scrolled to, and the slotted twin is neither scrolled to nor focused.

Merge and regeneration

The only file the merge resolved by hand is content/docs/references/data/object.mdx, which took the branch's side of the highlightFields row. 6d0988c0 then regenerated it, and the row now matches main (#35977's text). Nothing else in the merge differs from the automatic result.

Nits

  • Tabbed form. A line-row refusal raised on Save can sit in a tab that is not active. If the existing refusal path does not already switch tabs or name the tab, a follow-up card is enough.
  • The rule is in two places. placeFormSlots and bodyTablePlacement both decide where a group-placed table sits. The body already names this as a follow-up candidate. Fine as a follow-up.

Checked and fine

  • Shape. Draft, base main. Fixes #35889 is right: this is S2, it delivers acceptance line 2 (the entry form places the table at its group), and S1 (feat(spec, ui): a master_detail child is a tab by default; a field group puts it in the overview and the form #35921) was Part of.
  • Placement.
    • placeFormSlots(sections, sectionGroupKey, fieldGroups, requests) puts a slot after the sections of the groups declared before its group and before those declared after it. That is the record page's bodyTablePlacement rule.
    • A section that names no declared group (the ungrouped bucket, an authored section) counts as after every group.
    • Sections keep their order, and slots at one position keep the request order.
    • A layout none of whose sections names a declared group places nothing, so the table stays below the fields.
    • claim runs once per drawn layout and never while loading, so a remounting header does not make the table jump.
    • formSlots.test.ts (6 cases) covers these. MasterDetailForm.groupPlacement-35889.test.tsx (6 cases) runs it through the real MasterDetailForm → ObjectForm → form.tsx chain, flat and tabbed.
  • The form-slot row. form.tsx renders an empty div[data-form-slot] and keeps it out of the drawn and changeable sets, so it adds no value, no dirty state and no section-nav item. splitAtUntitledRuns gives it a block of its own after the heading that claims its fields.
  • The header scrape. scrapeHeaderRecord skips [data-form-slot], so line inputs never leak into the header record. handleSave's querySelector('form') still returns the header form, which comes first in document order.
  • Keyboard. Every GridField button is type="button", Enter in a cell calls preventDefault, and the header is built with showSubmit: false. Since 25b2e82f the wrapper form backs all three.
  • Contract text. The ObjectFieldGroupSchema.relatedList and FieldSchema.relatedList describe and JSDoc, the related-list-body-table.ts header and its describe pin, the regenerated object.mdx, and the acceptance line of semantic migration semantic/18.master-detail-related-list-tab-by-default now say the form places the table at its group. The migration text cites no #ids. The ADR-0035 note is add-only: S1's sentences stay as written, and the note names the one it supersedes.
  • Changesets.
    • .changeset/35889-form-places-detail-at-group.md is new and declares @object-ui/plugin-form, @object-ui/components and @objectstack/spec, all patch. That matches the shipped JSDoc and describe text. I read it sentence by sentence against the diff.
    • Deliberate correction, checked. Check Changeset is red because one line of .changeset/35889-master-detail-tab-by-default.md (S1, feat(spec, ui): a master_detail child is a tab by default; a field group puts it in the overview and the form #35921, merged and still pending on main) is rewritten. The old line said the entry form still put the table below the fields, and this PR makes that false. The new line matches the diff, including the fallback for a form whose sections name no group. The body declares it under "DELIBERATE CORRECTION". The seat's ACCEPT will carry the confirmation, so restoring the old line is not owed.
  • Evidence. Screenshots exist at 1280 and 375. between-light-375 shows the table between the groups around it.
  • Overlap watch. buildDefaultPageSchema.ts and RecordDetailView are untouched. related-list-body-table.ts changes in text only.

Gates

At 84dc199e27: 61 success, 11 expected skips, 0 pending. The only red is Check Changeset, twice (two runs). Both logs fail on exactly one file, .changeset/35889-master-detail-tab-by-default.md, which is the deliberate correction confirmed above, so that red is by design. mergeable_state is unstable only because of it. l1-face flags that check and nothing else.


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Posted 2026-11-21T07:08Z. The brief handed to the isolated reviewer at CONTRACT_REVIEW_TIER for PR #36009 (contract face: docs/adr and packages/spec paths). The seat adds one ask: judge the declared DELIBERATE CORRECTION sentence that makes Check Changeset red. The record follows as its own comment.

Seat addition: Check Changeset is red by design on this head (a DELIBERATE CORRECTION of the pending note .changeset/35889-master-detail-tab-by-default.md, before and after quoted in the PR body). Judge whether the corrected sentence is true against the diff, in ②.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Posted 2026-11-21T07:09Z. Replaces the seat's previous brief comment on this PR, which went out without its brief text. The brief handed to the isolated reviewer at CONTRACT_REVIEW_TIER for PR #36009 (contract face: docs/adr and packages/spec paths). The record follows as its own comment.

Contract review brief — PR #36009 @ 84dc199e27e7bea464bcb3447e2b61ec23d59e71 (card #35889)

You review at CONTRACT_REVIEW_TIER. Render ONE ## Contract review record on this head — its shape is
node scripts/pm/record-recognisers.mjs --template --paths packages/spec/src/data/field.zod.ts packages/spec/src/data/object.zod.ts packages/spec/src/data/related-list-body-table.ts packages/spec/src/migrations/entries/semantic/18.master-detail-related-list-tab-by-default.ts docs/adr/0035-config-driven-master-detail.md — with a PASS or FAIL verdict, and post it as ONE comment
on the PR or its card.

Inputs — these and nothing else:
· card #35889: its body and EVERY comment (rulings and earlier records included)
· PR #36009: its body, its file list, and the net diff against main at 84dc199e27e7bea464bcb3447e2b61ec23d59e71
· the check-runs on 84dc199e27e7bea464bcb3447e2b61ec23d59e71: their conclusions ARE the gate verdicts
⛔ Not the dispatch order, ⛔ not the dispatching seat's own conclusions — this brief is adversarial by design.

Scope — the paths reviewFace returns as hits on this PR's file list: packages/spec/src/data/field.zod.ts, packages/spec/src/data/object.zod.ts, packages/spec/src/data/related-list-body-table.ts, packages/spec/src/migrations/entries/semantic/18.master-detail-related-list-tab-by-default.ts, docs/adr/0035-config-driven-master-detail.md;
plus every file IN THIS DIFF that directly implements or enforces them — the gate that enforces a rule, the code
a jsdoc or schema line describes, the validator a skill teaches — reviewed for agreement with the contract.
Widen it freely, ⛔ never below hits; the record's Scope: line names the implementing files apart from hits.
The rest of the diff (tests, unrelated modules, lockfiles, generated output, changesets) is the lane seat's
ACCEPT at TIER_DEFAULT, exactly as a standalone PR of those files.
④ judges the hits files and those implementing files ONLY:
lockfiles, generated output, changesets and prose elsewhere in the PR are not reviewed;
code outside the diff is READ to judge them, never reviewed.

Security — a hits path sits on the low-risk skills arm: when the change teaches security, auth or permission
behaviour the path name doesn't show, the record says so and the seat adopting the record adds the security label.
The record says so on its Security-touching: line, and the arm lands on no alone: write no ONLY when no changed
hunk teaches permission, sharing, credential, token, authentication or other security behaviour, else yes.

⛔ READ-ONLY. No worktree, no checkout, no build, no test run, no gate re-run, no ablation: the check-runs
on the head already answered every derived gate family, and a local run costs more than it returns.
If ONE probe is unavoidable, the record's Local-runs: line says probe — REASON; otherwise none.
Scratch space is /tmp/claude-0/-home-user/3d3cbaf6-4903-5fed-92d4-c2b94a45e868/scratchpad/pr-36009/ alone; nothing there you did not write this round is read.

Judge, in the record's own sections:
① Derived judgments — every accept-set and public-surface change the diff implies, each named right or wrong.
② Semver level — the changeset (or skip-changeset) matches what the diff publishes, and the Clause-②: line.
③ Boundary flags — every dev flag and every open_questions entry answered, or escalated.
On every face, SQL push-down: a new id materialisation or in-app join where SQL could push down is a
finding unless a reason is given (AGENTS.md, Prime Directive 5: SQL first).
④ Design judgment — for EVERY hits file: does the change hold against the code it cites and the
scenario it is accepted against? A skill file against the card's eval prompt and the spec it teaches
on main; a schema file against the ruling or ADR it implements and its first consumer; an ADR
against its first consumer and its execution plan. For EVERY implementing file in the diff: does the
code agree with the contract, sentence by sentence? Read the cited code in the live tree, and try to
break the design.
Grade each finding must-fix, should-fix or nit — a nit has no effect on correctness or the contract.
A must-fix is a FAIL; a must-fix or should-fix earns a delta review of its fix; nits alone end the round.
Spell a must-fix or should-fix with its id and grade, S1 (should-fix) — …, and a clean round as
No must-fix, no should-fix.: the queue guard reads a graded finding as OPEN on this head and
refuses the record; the delta record names those it closes by id alone, S1: closed.
A nit is fixed only on the prose faces, or left as an accepted deviation or a follow-up card: a fix
anywhere else moves the head, and this record no longer covers it.
⛔ Judge the tree, never the PR body's account of it.
Sign Implemented-by: with the dev's branch and Reviewed-by: with your session id — the value is the FIRST
thing after each colon.

Seat addition: Check Changeset is red by design on this head (a DELIBERATE CORRECTION of the pending note .changeset/35889-master-detail-tab-by-default.md, before and after quoted in the PR body). Judge whether the corrected sentence is true against the diff, in ②.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 84dc199e27e7bea464bcb3447e2b61ec23d59e71
Local-runs: none
Scope: packages/spec/src/data/field.zod.ts, packages/spec/src/data/object.zod.ts, packages/spec/src/data/related-list-body-table.ts, packages/spec/src/migrations/entries/semantic/18.master-detail-related-list-tab-by-default.ts, docs/adr/0035-config-driven-master-detail.md + ui/packages/plugin-form/src/formSlots.ts, ui/packages/plugin-form/src/MasterDetailForm.tsx, ui/packages/plugin-form/src/ObjectForm.tsx, ui/packages/plugin-form/src/TabbedForm.tsx, ui/packages/components/src/renderers/form/form.tsx
Security-touching: no

PR #36009 (slice S2 of card #35889, Fixes #35889), net diff against main (merge base ec2436397). Inputs read: the card body and all seven comments (hold, hold lifted, S1 claim 7046107172, ruling B record 7046311205, triage, claim amendment 7048168819, S2 claim 7057842463), the PR body, the 18-file list, the diff, and the check-runs on this head. The remainder of the diff (the five test files, the two changesets, the regenerated content/docs/references/data/object.mdx) is the lane seat's ACCEPT at TIER_DEFAULT; the changesets are read in ② only for level and for the truth of the corrected sentence.

① Derived judgments

  • Accept set of @objectstack/spec: unchanged. Right. The five spec hunks are text only: the jsdoc on FieldSchema.relatedList, the jsdoc and the .describe() string on ObjectFieldGroupSchema.relatedList, the header comment of related-list-body-table.ts, and the acceptanceCriteria string of migration entry semantic/18. No key, type, regex, refinement, default or export moves. isGroupPlaceableRelationship, isBodyTableRelationship and fieldGroupsPlaceRelationship are byte-identical to main.
  • Published description of fieldGroups[].relatedList: changed, and the generated face follows. Right. The describe string is published through the JSON schema and content/docs/references/data/object.mdx; both rows of the mdx carry the new sentence, the describe pin in related-list-body-table.test.ts is moved to it, and Lint · docs & code guards, Build Docs and Lint & Repo Gates are green on this head.
  • Migration entry semantic/18: one sentence of acceptanceCriteria reworded, no baseline moved. Right. id, surface, replacement and reason are untouched; the changeset gate's level axis reports "moves no metadata-protocol baseline" on this head, which agrees with Metadata-protocol: none.
  • Public surface of @object-ui/plugin-form and @object-ui/components: no new export. Right. formSlots.ts is imported only by MasterDetailForm.tsx, ObjectForm.tsx and TabbedForm.tsx; the hand-off key formSlots is typed in that module (FormSlotHandoff) and is not added to ObjectFormSchema in @object-ui/types. The form renderer learns one row type, form-slot, that only a host can produce (its slotRef is a function, never authorable metadata).
  • Behaviour derived for consumers: a group-placed collection moves from below the header form to inside it. Right, and bounded. It moves only when the header's drawn layout has at least one section naming a declared field group AND a field group names the collection; every other form keeps the old place (placeFormSlots returns plain, the header claims [], FormSlotStore.placement answers 'inline'). No metadata is rewritten and none is newly refused.
  • Gate verdicts on this head: every check-run is success or skipped except Check Changeset (two runs, both failure). Its log on this head carries exactly one error, the changed-not-added refusal for .changeset/35889-master-detail-tab-by-default.md; the empty-changeset, ADR-0087 registration and level-axis steps of the same job pass. That refusal is the declared DELIBERATE CORRECTION, judged in ②.

② Semver level

  • New changeset .changeset/35889-form-places-detail-at-group.md: @object-ui/plugin-form patch, @object-ui/components patch, @objectstack/spec patch. This matches what the diff publishes: description text in spec, and in the two ui packages a layout change of an existing surface with no new export and no accept-set change. Patch is right for all three.
  • Clause-②: no — stated on the PR body and in the new changeset, and it agrees with the tree: nothing a consumer may write, import or call is added or removed. The S2 claim (7057842463) declared the same line with the same reason.
  • Metadata-protocol: none on both: right, see ①.
  • The DELIBERATE CORRECTION of .changeset/35889-master-detail-tab-by-default.md is confirmed. One line changes; the rest of the note is byte-identical. The sentence it replaces ("a placed table still sits below the record's fields ... Moving it to its group's place in the form is a follow-up") is false on this head, so restoring it would publish a false release note. The corrected sentence, clause by clause against the diff:
    • "a placed table sits at its group's place too: between the sections of the groups around it" — true: placeFormSlots emits a slot after every section whose group index is lower than the placing group's and before the first section whose index is higher, and SimpleObjectForm pushes a form-slot row at that point of the one field list.
    • "or in a tab of its own (labelled with the group) in a tabbed form" — true: TabbedForm builds a tab keyed by the group key, labelled through sectionLabel(objectName, group.key, group.label || group.key), at the same sequence position; two collections of one group share the tab.
    • "A form whose sections name no field group keeps it below the record's fields" — true: placeFormSlots returns the plain sequence with placed: [] when no section's name is a declared group key (pinned in formSlots.test.ts), and a form with no sections at all never enters the sectioned arm (drawsSections false, claim []).
      The sentence is silent on one mixed layout; see N1. It states nothing false.

③ Boundary flags

  • Follow-up 1 (the ordering rule is spelled twice, bodyTablePlacement and placeFormSlots): answered, accepted as a follow-up card. I read both on this head; they are the same algorithm (group index by first key, a section naming no declared group at positive infinity, flush placed entries below the section's index, remainder at the end). A shared helper needs a new export, which this PR is right not to add under Clause-②: no. N1 belongs on that card.
  • Follow-up 2 (a form section { group: 'lines' } resolves to nothing): answered, unchanged and harmless here. resolveSectionGroupReferences returns an unnamed empty section for it, the simple arm drops an empty section, and the slot is still placed by the group order, so no duplicate tab key and no double draw arises.
  • Follow-up 3 (the jump highlight styles heading rows only): answered, cosmetic, accepted as written.
  • Follow-up 4 (neighbours fix(form): new master-detail form lines start on the child's defaults and skip an untouched line with a notice (#35940) #35984 on MasterDetailForm.tsx, feat(spec): relatedLists is the record page's tab list, with built-in tabs by object name and per-entry title and columns #35923 on docs/adr/0035): answered, a merge-order matter for the seat; the ADR hunk here is add-only, so a textual conflict there cannot drop a sentence of either side silently.
  • Claim open_questions: none on the S2 claim. The card's two undecided items (relatedList: 'primary' standing alone; where a save lands) are untouched by this diff, as the card requires.
  • SQL push-down: no finding. The diff adds no query, no id materialisation and no in-app join; the lines are still loaded and written by the code paths on main (one batchTransaction), and the new code only moves where they are drawn.
  • Security: no changed hunk teaches permission, sharing, credential, token or authentication behaviour. Field-level permission gating of sections (gateFields) runs as before and a slot row holds no value.

④ Design judgment

No must-fix, no should-fix.

Spec hits against the implementing code, sentence by sentence.

  • field.zod.ts jsdoc, "inlines it in the parent's entry form at the same place (a form whose sections name no field group keeps it below its fields)": holds. Simple form: SimpleObjectForm computes placeFormSlots over effectiveSections (authored sections, or the sections derived from fieldGroups, whose name is the group key per deriveFieldGroupSections), and the sectioned arm pushes one form-slot row per placed collection. The parenthesis holds by the plain return.
  • object.zod.ts jsdoc and describe, "the parent's entry form inlines it here too, or below its fields when the form's sections name no field group": holds, same code. "here too" is loose for a tabbed form (a tab at this position, not a table between sections); the migration entry and the ADR note say the tab in full, so the short form is acceptable in a describe string.
  • related-list-body-table.ts header: holds; the predicates below it are unchanged and formSlotGroupIndex reads placement through fieldGroupsPlaceRelationship, the reader that header names, so there is still no second judgement of what a group names (a bare child name places every FK of the child, object.field one; a request with no FK is placed only by a bare name, pinned).
  • Migration entry semantic/18 acceptance, "the create and edit forms inline the table at the same place (a tab of its own in a tabbed form)": holds for the scenario it is written for (the default form of an object whose first group has fields and whose second group names the child). Create and edit share the code path; the edit case is pinned ("edit mode with loaded lines at the group and drawn once").
  • ADR-0035 note: add-only, placed directly after the amendment whose clause it supersedes, and it quotes that clause accurately (lines 165-166 of the file on this head). Each sentence agrees with the code: the ordering rule (placeFormSlots), the tab and its label (TabbedForm), the wizard drawn as the simple form (ObjectForm passes formType: 'tabbed' or 'simple' to MasterDetailForm, on main already), the two cases that stay below, one batch and totals at the foot (MasterDetailLines keeps the totals outside FormSlotPlacement; submitViaBatch is untouched). First consumer: MasterDetailForm, in this diff.

Attempts to break the design, and what held.

  • A claimed collection with no slot element is drawn nowhere (placement answers null), so a claim the layout does not honour would make the lines vanish. I checked each route: the simple arm's condition is the same expression as drawsSections; error, submitted and record-not-found claim []; loading makes no claim; the tabbed arm keeps every panel mounted (forceMount on TabsContent), so a slot in an inactive tab still holds its collection; the hand-off key survives the tabbed route (...schema spread) and the drawer and modal hosts go through the same MasterDetailForm. No route claims without drawing.
  • The slot element is a DOM descendant of the header's form element. Form ownership is answered by the wrapper form in FormSlotPlacement (noValidate, a disabled hidden default button, preventDefault), pinned in the DOM test; React events from the portal follow the React tree (MasterDetailLines), not the header, so the header's handlers never see line events; the three DOM reads that cross the boundary are each fenced (scrapeHeaderRecord skips [data-form-slot], fieldWrapper skips fields inside this form's slots while a nested editor still finds its own, and formHostRef.querySelector('form') returns the header form because an ancestor precedes its descendants in document order).
  • The form-slot row in the renderer follows the section-divider precedent at every site that matters: it returns before any control is registered, is excluded from the AI-change sets, and is reported to the section navigation only when labelled and actually drawn.
  • Group visibleWhen: the record page's bodyTablePlacement does not gate a placed table on its group's predicate either, so form and record page agree.

Nits (no effect on correctness of the contract as written; none needs a fix on this head).

  • N1 (nit) — Mixed layout. A section that names no declared group counts as after every group, so when such a section LEADS an authored layout that also has group-named sections (for example [{ label: 'Basics', fields }, { group: 'totals' }] with the placing group declared before totals), the table is drawn above it, at the top of the form, where before this PR it sat below the fields. This is exactly what bodyTablePlacement does on main for the same sections, so "where the record page draws it" still holds, and no published sentence promises otherwise; but the changeset and ADR wording ("after the sections of the groups declared before the placing group") reads as if it covered it. Put it on the shared-helper follow-up card so both surfaces decide it once.
  • N2 (nit) — The expanded row editor is drawn inside the wrapper form when its collection is placed, and it renders an ObjectForm of its own, so a form element is now a React child of a form element there. The DOM accepts it and ownership stays correct (innermost form), but React's DOM-nesting check may log a development warning, and none of the 13 new pins opens a row editor in a placed slot. Read from the tree, not run. Follow-up: one pin for that case.
  • N3 (nit) — In a tabbed form the lines used to be visible under every tab; placed, they are in one tab, and a line-level validation failure on Save does not mark that tab the way an errored header field marks its tab (erroredFieldTabs knows header fields only). Follow-up card.
  • N4 (nit) — First paint: until the header makes its first claim (object schema or record still loading) the collection is drawn in its old place, then moves into the slot; the fragment-to-portal switch remounts the lines subtree once. Row state lives in MasterDetailForm, so nothing is lost. Cosmetic.

Implemented-by: claude/project-thread-3lahxp
Reviewed-by: isolated L2 sub-agent of seat session_01L6bhgUkbQqRUUFSiu2HGob

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Tier H approval request · 2026-11-21T07:16Z · @os-zhuang, PR #36009 (#35889 S2, Fixes #35889) is ready for your review on head 84dc199e27. It is governed because it touches docs/adr/0035-config-driven-master-detail.md.

What it does: a master-detail child that a parent field group places now sits in that group's place in the create and edit forms. The three form layouts each handle it: simple (between the sections of the groups around it), tabbed (a tab of its own labelled with the group) and wizard. With no section naming a field group, it stays below the fields, as before.

After your approval, the seat readies this PR and lands it.

@objectstack-fleet objectstack-fleet Bot added the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 21, 2026
…-3lahxp

# Conflicts:
#	ui/packages/plugin-form/src/MasterDetailForm.tsx
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgXtcSJVbw8Gny1ERbP

维护者速读

  • 这次只是把主干(包括刚合并的“新明细行带默认值”那张卡)合进来。两边都给明细表组件加了参数,合并时两边都保留了,没有改任何逻辑。
  • 两张卡合在一起后的行为:明细表照样放在分组的位置,新加的行照样带默认值,没改过的空行照样跳过并提示。所有测试都通过。
  • 要你做什么:现在不需要。

席位核对 — ACCEPT (L1-c) · repo:objectstack#1 · head 97afed5aab · 2026-11-21T08:38Z

Merge-only delta: 84dc199e → 97afed5a, the merge of main through 141a826f, which includes #35984 (32409a97). I read it with git show --remerge-diff 97afed5aa. My ACCEPT at 84dc199e27 (7059056513) covers everything else.

The hand resolution

The only file resolved by hand is ui/packages/plugin-form/src/MasterDetailForm.tsx, with 3 hunks, each keeping both sides:

No line from either side is dropped or rewritten. Every other file merged automatically.

The two features together

Gates

At 97afed5aab: 62 success, 11 expected skips, 0 pending. The only red is Check Changeset, twice. Both logs fail on .changeset/35889-master-detail-tab-by-default.md alone, which is the confirmed deliberate correction, so the red is by design.


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 97afed5aab44ab898b1c29ea8429ad056fcdb981
Local-runs: none
Scope: packages/spec/src/data/field.zod.ts, packages/spec/src/data/object.zod.ts, packages/spec/src/data/related-list-body-table.ts, packages/spec/src/migrations/entries/semantic/18.master-detail-related-list-tab-by-default.ts, docs/adr/0035-config-driven-master-detail.md + ui/packages/plugin-form/src/formSlots.ts, ui/packages/plugin-form/src/MasterDetailForm.tsx, ui/packages/plugin-form/src/ObjectForm.tsx, ui/packages/plugin-form/src/TabbedForm.tsx, ui/packages/components/src/renderers/form/form.tsx
Security-touching: no

Delta round on PR #36009 (card #35889). The previous record covers head 84dc199e27e7; this head is a merge commit whose parents are 84dc199e27e7 and main at 141a826f4c12 (which carries #35984). Read with git objects and GET calls only; nothing was built or run.

① Derived judgments

  • The merge resolution touches one file. Right, as the dev states. git show --remerge-diff on this head lists only ui/packages/plugin-form/src/MasterDetailForm.tsx, 9 lines removed, all of them conflict markers. There are three conflict regions: the MasterDetailLinesProps interface (the dev's -883 and -900 are the opening and closing markers of this one region), the destructure at -964, and the call site at -2375. Each is resolved keep-both: slotStore first, then fix(form): new master-detail form lines start on the child's defaults and skip an untouched line with a notice (#35940) #35984's newRowValuesByChild and newRowRequiredShown. No line of either side is dropped or altered.
  • The PR's own patch is unchanged by the merge. Right. The added and removed lines of the net diff against the new merge base are identical to those of the reviewed diff, for MasterDetailForm.tsx and for the other 17 files separately (compared line set to line set). The file list is the same 18 files, 801 insertions and 26 deletions. The five hits files and the two changesets are byte-identical to the reviewed head; main did not touch them.
  • Gate verdicts on this head: all check-runs are completed. Every one is success or skipped except Check Changeset (two runs, both failure), whose annotation is the same single changed-not-added refusal for .changeset/35889-master-detail-tab-by-default.md as on the previous head. Test UI (16 of 16 shards), Test Core (10 of 10), Type Check UI, TypeScript Type Check, Lint UI, Lint & Repo Gates, Build & E2E UI, Live E2E UI, Dogfood Regression Gate, Spec property liveness and both Governed Surface Queue Guard runs are success. The pull request reports mergeable_state: unstable, which is that one red check.

② Semver level

Unchanged from the record on 84dc199e27e7: the two changesets are byte-identical, patch for the three packages still matches what the diff publishes, and the DELIBERATE CORRECTION stays confirmed (the corrected sentence is still true against this tree, since the placement code is unchanged).
Clause-②: no — still agrees with the tree; the merge adds no export and no accept-set change to this PR's patch.

③ Boundary flags

④ Design judgment

No must-fix, no should-fix.

Carried from the previous record, unchanged and still nits only: N1 (a leading section naming no group pulls the table to the top, as on the record page), N2 (row editor form nested in the slot's wrapper form, unpinned), N3 (a line error does not mark the lines tab), N4 (one remount on first claim).

Implemented-by: claude/project-thread-3lahxp
Reviewed-by: isolated L2 sub-agent of seat session_01L6bhgUkbQqRUUFSiu2HGob

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Seat note · 2026-11-21T08:40Z · @os-zhuang, both reviews now stand on the head you enqueued, 97afed5aa (the merge of main after #35984): L1-c merge-only ACCEPT 7060059593, and the CONTRACT_REVIEW_TIER delta PASS above. That head has 3 keep-both hunks in MasterDetailForm.tsx, nothing dropped, and the PR patch is otherwise byte-identical. CI: everything is success or skipped except Check Changeset, which is the declared DELIBERATE CORRECTION of S1's pending note (confirmed true in both records). At the time of this note the PR is open with no auto-merge armed and is not merged, so the queue may have dropped it on that red. If so, it needs your hand once more.

Merged via the queue into main with commit 6b51822 Nov 21, 2026
73 of 75 checks passed
@os-zhuang
os-zhuang deleted the claude/project-thread-3lahxp branch November 21, 2026 09:08
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 22, 2026
…save refused on placed lines marks their tab (objectstack-ai#36088)

<!-- claude-projects-attribution: {"github_login":"os-sales"} -->
_Requested by **Sales** · [project
thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuVwX4pUdM1qvNLSqRZNSvv3)_

Fixes objectstack-ai#36019

Clause-②: no
Metadata-protocol: none
Skills-docs: none — no authorable key and no behaviour a skill teaches
moves
repo:objectstack#1 · os-sales · session_01L6bhgW85kwjGaz7HqsmEuv

## 维护者速读

-
用户能看到什么变化:在“表头加明细”的录入表单里,明细表放在某个字段分组处时,展开一行明细编辑不再在开发控制台报“表单嵌套表单”的警告;分页签的表单里,保存被服务器以某一行明细为由拒绝时,明细所在的页签会像表头字段出错时一样标红点。
- 为什么做:这是“明细表放在字段分组处”那项工作(主从表单布局)评审时留下的两条收尾意见,补上明细出错时用户找不到原因的缺口。
- 出错会怎样:最坏情况是明细页签该标红没标、或多标了一个页签,保存本身照旧被拒、数据不会写错;整个改动可直接撤回。
- 要你做什么:无

## What changes

1. **Row editor in a placed slot (N2 of the L2 record on objectstack-ai#36009).**
`FormSlotPlacement` takes `ownsForm`: when its children already are a
form of their own, it portals them into the slot with no wrapper form.
The expanded row editor (an `ObjectForm`, its only other control a
`type="button"`) is placed with `ownsForm`, so its form is no longer a
React child of the slot's wrapper form, and React's DOM-nesting check
stops logging "form cannot be a descendant of form". This is the
measured S2 patch, re-applied on main (`git apply --check` clean,
offsets +24/+78).
2. **Tab marker for a refused line (N3 of the L2 record, L1-c's nit).**
A batch refusal is attributed to the placed collections it was refused
on, using the same evidence the record page's
`attributeRecordEditRefusal` reads: the operation the server names in
`details.failedOperation.index` when it names one (a line's operation,
never operation 0, the parent), else each field in `fields[]` that only
line operations write. A field the parent operation carries stays the
header form's to mark. `FormSlotStore` records those collection ids
(`refuse(ids)`, cleared when the next save gets past validation, as the
renderer clears its own markers). `TabbedForm` subscribes to the store
and rebuilds its slot rows, each carrying `slotRefused` when its
collection was refused. The form renderer's `erroredFieldTabs` marks the
tab of a refused slot row with the treatment a refused header field gets
(`data-error`, destructive text, the dot).

No export, prop or i18n key is added. `FormSlotHost` and `FormSlotRow`
live in `formSlots.ts`, which `@object-ui/plugin-form` does not export.
The renderer reads `slotRefused` off a `form-slot` row the same way it
reads `slotRef`: a key only a host can produce.

## Tests

- `MasterDetailForm.groupPlacement-35889.test.tsx`, existing describe:
an expanded row editor opens in the slot beside its collection, its
inputs are owned by its own form, and no nesting warning is logged.
- Same file, new top-level describe (a refused save marks the tab of the
placed lines it was refused on): a field only a line writes marks the
lines tab and not the header tab; a server-named failed line operation
marks the lines tab; control: a refusal on the header's own field marks
its tab and leaves the lines tab unmarked.
- `formSlots.test.ts`: `refuse` marks the slot row until retired,
de-duplicates, and an equal refusal emits nothing.

All readings at head `9ac514e3`.

<details><summary>Suites and type-check</summary>

- `pnpm exec vitest run --maxWorkers=2 packages/plugin-form/
packages/components/src/renderers/form/` (from `ui/`, under the verify
lock): `Test Files 332 passed (332)`, `Tests 3359 passed | 18 skipped
(3377)`, `VERDICT command-exit 0`.
- `pnpm --filter @object-ui/plugin-form --filter @object-ui/components
run type-check` (both run `tsc --noEmit && tsc -p tsconfig.test.json`):
`VERDICT command-exit 0`.
- `eslint` over the six changed source and test files: 0 errors (106
warnings, all on lines this diff does not touch).

</details>

<details><summary>Ablations (one per fix, through
`scripts/ablation-replace.mjs`, restore proven)</summary>

- Fix 1: `ownsForm` removed from the row editor's placement (anchor 1 to
0, blob `632b58a14b7d` to `f73ce79e3a8b`). The nesting pin goes red with
React's own message, "In HTML, a FORM cannot be a descendant of a FORM"
(its DOM-nesting check); `Tests 1 failed | 10 passed (11)`. Restored:
blob equals HEAD (`632b58a14b7d`), `git diff HEAD` empty. This mutation
is the code on `main`, so the pin fails on `main` and passes with the
fix.
- Fix 2: the `slotStore.refuse(...)` call in `sendBatch`'s catch deleted
(anchor 1 to 0, blob to `2e2969a6db0b`). Both tab pins go red, and the
control (a header-field refusal) stays green; `Tests 2 failed | 9 passed
(11)`. Restored: blob equals HEAD, `git diff HEAD` empty.

</details>

<details><summary>Derived gate families</summary>

`node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack`: 38 commands. Every one exited 0. `--ran`
reconciliation: "38 derived famil(ies) accounted for — 38 run, 0
NOT-MEASURED (a DERIVED zero — all 38 recorded an exit code and none of
them is 3)". The type-check lanes, artifact rosters and wide-population
families are CI's.

</details>

<details><summary>Overlap</summary>

`node scripts/pm/overlap-check.mjs --branch=HEAD --pr=36039,36054`:
origin/main, objectstack-ai#36039 and objectstack-ai#36054 each merge cleanly, `VERDICT clean exit
0`.

</details>

## Acceptance notes

- The marker is the whole of the header-field treatment that applies
here. A refused header field also activates its tab and focuses the
field; a refused line does not switch tabs, because the renderer's catch
runs before the host's refusal reaches the tab rows, and the lines show
no per-row reason today (the master-detail form shows the refusal as the
form's banner, as before). The acceptance names the marker only.
- A refusal that names neither a failed operation nor a field (a lock, a
permission denial) is on no collection, and marks nothing, as before.
- File surface beyond the claim's wording: the tab marker is drawn by
the form renderer
(`ui/packages/components/src/renderers/form/form.tsx`), not by
`TabbedForm`, and the refusal travels through `formSlots.ts`. Both are
named here.
- The editor's form still sits inside the header's form in the DOM (the
slot element is inside it), as the lines' wrapper form already did;
ownership is answered by the innermost form, which the pin asserts.

## Verification

Two-minute check: `pnpm --dir ui exec vitest run --maxWorkers=2
packages/plugin-form/src/MasterDetailForm.groupPlacement-35889.test.tsx`:
expect 11 tests passed.

Read first: (1) `MasterDetailForm.tsx` `refusedChildObjects` and its
call in `sendBatch` (which refusals count as a line's); (2) `form.tsx`
`erroredFieldTabs` (the renderer's new read); (3) `TabbedForm.tsx` the
`useSyncExternalStore` on the slot host.

---

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01L6bhgW85kwjGaz7HqsmEuv

---------

Co-authored-by: Claude <noreply@anthropic.com>
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 22, 2026
… tabs by object name and per-entry title and columns (objectstack-ai#35923)

<!-- claude-projects-attribution: {"github_login":"os-sales"} -->
_Requested by **Sales** · [project
thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4Uu8asiBATVNp4pogcic92dHU)_

repo:objectstack#1 · os-sales · session_01L6bhgTgsPwrw3VbvRRcqth

Fixes objectstack-ai#35897
Fixes objectstack-ai#35899

Clause-②: yes (widening)
Metadata-protocol: semantic
Skills-docs: follow-up objectstack-ai#35902
(skills/objectstack-data/rules/relationships.md,
skills/objectstack-ui/rules/record-page.md)

## 维护者速读

- 对象声明了 `relatedLists`,详情页的标签页就只显示列出的相关列表,按列出的顺序;没列的不再显示。没声明(或为空)时完全不变。
-
三个内置标签用对象名放置:`sys_attachment`(附件)、`sys_approval_request`(审批)、`sys_activity`(活动流);附件不列就不显示,审批和活动流不列时仍排在末尾。
- 每一项可写 `{ list, label, columns }` 给该列表自己的标题和列;列名不是子对象字段会被 `os
validate`、`os build` 和元数据写入口拒绝。
- 字段分组放进概览的主从明细表(objectstack-ai#35889):没声明 `relatedLists`
时既在概览里、也保留页签;声明了但没列它,就只在概览里,不出页签(席位裁定 7048340194)。
- Studio
对象设置里可以排页签、加内置标签、给每一项改标题和列;保存时保留对象写法和内置名。对象没开文件时,附件不出现在可选项里,已列的附件会提示不会显示。
- 元数据管理里的通用对象表单也能正确显示和编辑这张页签表了(之前遇到带标题和列的一项会出错);条目的列可以写
`account.industry` 这种跨关系的写法,和外键上的写法一致。
- 其他包加进来的子表也一样:父对象声明了 `relatedLists` 却没列它,就不显示页签;让扩展包自己放置列表的做法在 objectstack-ai#35901。
- 风险:已经声明了部分 `relatedLists` 的应用,没列的标签会消失(仓库内无此类对象;已部署的元数据未测量)。

## What changes

An object's declared `relatedLists` becomes its record page's tab list
(epic objectstack-ai#35896):

```ts
relatedLists: [
  { list: 'quote_line', label: 'Line items', columns: ['product', 'quantity', 'unit_price', 'amount'] },
  'task',
  'sys_attachment',
  'sys_approval_request',
  'sys_activity',
],
```

- **spec** (`packages/spec/src/data/object.zod.ts`, new
`related-list-entry.ts`): an entry is the bare name or `{ list, label?,
columns? }` (strict, with aliases and guidance). The three built-in tabs
are named by object: `sys_attachment`, `sys_approval_request`,
`sys_activity`. A built-in is written only as its bare name; the object
form naming one is refused at parse (a regex, so the published JSON
schema keeps the refinement). `defineStack`'s name check skips
built-ins. The shared helpers `RECORD_PAGE_BUILTIN_TABS`,
`isRecordPageBuiltinTab`, `relatedListEntryName` and
`RELATED_LIST_BUILTIN_PART_OF` are the one reading of an entry's name
for every reader.
- **lint** (`validate-related-list-refs`): new
`related-list-column-unknown` (error: a column that is no field of the
child, registry-injected columns included),
`related-list-attachments-off` (warning: `sys_attachment` on an object
without `enable.files`) and `related-list-stream-part` (warning:
`sys_comment` / `sys_audit_log` are parts of the stream; prescribes
`sys_activity`). The same rule runs at `os validate`, `os build` and the
metadata write door.
- **record page** (objectui):
- `deriveRelatedLists`: on a declared non-empty `relatedLists`, an
unlisted side list shows no tab. Body tables a field group places are
kept, and `relatedList: false` on the FK still hides a list. An entry's
`label` / `columns` win over the FK's `relatedListTitle` /
`relatedListColumns`.
- `buildDefaultPageSchema` (`arrangeDeclaredTabs`): tabs follow the
declared order. An unlisted attachments tab is dropped. Unlisted
approvals follow the listed tabs. An unlisted stream closes the strip.
The overview stays first.
  - `recordPageColumns`: the related column keeps that one order.
- With objectstack-ai#35921 merged: a `master_detail` table that a field group places
in the overview keeps its tab only while `relatedLists` is undeclared or
lists it. A declared `relatedLists` that leaves it out shows it in the
overview with no tab (seat ruling 7048340194 on objectstack-ai#35897). objectstack-ai#35921's
ADR-0035 note and `semantic/18` acceptance text are qualified to say so.
objectstack-ai#35921's changeset stays as main has it; this PR's own changeset narrows
it in one sentence (0215faf).
- **Studio** (`RelatedListsEditor`,
`relatedListVocabulary.acceptTabListEntries`): the object settings panel
edits `relatedLists` as the tab list. Object entries and built-in names
survive every move, removal and add. The add picker offers the built-ins
by name (attachments only when `enable.files` is on), then the unlisted
relationships. A relationship row edits its own title and columns;
clearing both writes the bare name again. A listed attachments tab on an
object without files shows a notice. The preview draws the tabs in
order, built-ins included. New strings in `@object-ui/i18n` (en, zh).
- **FLS mask** (`object-schema-fls-references.ts`): `relatedLists`
entries stay unmasked like `lookupColumns`: the columns are the child's
fields, the label is author text, and the built-ins are object names. A
pin test covers an entry whose column shares a denied field's name.
- **migration**: ADR-0087 semantic entry
`related-lists-declared-is-tab-list`. No D2 conversion, because which
unlisted lists an author still wants is recorded nowhere.
- **ADR notes**:
- ADR-0085 gets a dated note: §2's hide/re-arrange guard yields for
`relatedLists` only, per the maintainer's ruling.
  - ADR-0035 gets a dated amendment.
  - Both were drafted at the opus tier under the quota exemption.
- Generated references, the API surface, liveness children (`list`,
`label`, `columns`) and the strictness ledger counts are regenerated.

**Tier H**: this PR touches `docs/adr/**`.

## Why

The maintainer ruled that the record page's tabs are declared on the
parent object in one place: removing an entry removes its tab,
`relatedLists` is that list, and the three built-in tabs are named by
their objects. Before this change, a declared `relatedLists` only
ordered the lists: every unlisted list still followed, and the built-ins
always closed the strip in a fixed order.

## Tests

- spec: `stack-related-lists-order.test.ts` (object entries, built-ins,
the parse refusal, `defineStack`); new `related-list-entry.test.ts`.
- lint: `validate-related-list-refs.test.ts` (built-ins, both warnings,
unknown and injected columns); `rule-explanations` covers the three new
ids.
- metadata-core: `object-schema-fls-references.test.ts` (objectstack-ai#35899 entry
pin).
- Studio: new `ObjectSettingsPanel.relatedListsTabList-35897.test.tsx`
(5 tests); `ObjectSettingsPanel.relatedListsOrder-27054.test.tsx`
expects the built-in add options.
- ui: `buildDefaultPageSchema.test.ts`, new describe `declared
relatedLists arranges the tabs (objectstack#35897)`;
`deriveRelatedLists.relatedListsOrder-27069.test.ts`. Three tests that
pinned the old "unlisted lists follow" meaning now pin the new one: two
in the 27069 file, the 27241 case in `RecordDetailView.harness.test.tsx`
(with a new all-listed control), and the page-order expectations in
`ObjectSettingsPanel.relatedListsOrder-27054.test.tsx`. The 27069 file
also pins the ruling: a group-placed `master_detail` table keeps its tab
when `relatedLists` is undeclared or lists it, and loses only the tab
when unlisted.

## Acceptance notes

On the record page of each object that declares `relatedLists`, the tabs
after the overview are the listed related lists and built-in tabs, in
the listed order. Then come approvals, if unlisted and the record has
requests, and the activity stream last. An object that declares no
`relatedLists` shows the same tabs as before. In-repo census: no
example, platform object, dogfood fixture or HotCRM object declares
`relatedLists` today.

## Verification

On `462477f8` (the fixes above): `@objectstack/lint` 222 files / 9,369
tests passed; `@objectstack/platform-objects` 125 files / 2,126 tests
passed; `@objectstack/spec` `src/data`, `src/migrations`, `src/stack`
230 files / 7,961 tests passed; `check:generated --fix` regenerated
`content/docs/references/**` and is clean; `check-i18n-bundles --write`
clean; ui vitest on all of `app-shell/src/views/metadata-admin` and
`ObjectSettingsPanel*`: 772 files, two failures in the first run, both
resolved (the 9931 registry table, now carrying the new key, 40 passed;
`AddWidgetPicker.oneRegistry-26745` passes alone, 7 passed, and the diff
does not touch it).

On the merged head 3434287 (main 6c7c6db merged into 473c7ff;
conflicts listed below; 0215faf then touches only `.changeset/`):
`@objectstack/spec` test 961 files / 29,439 tests passed and
`check:generated` clean after `--fix` (it regenerated
`content/docs/references/**` and the liveness counts);
`@objectstack/lint` 222 files / 9,363 tests passed;
`@objectstack/metadata-core` 1,048 tests passed; ui vitest (from `ui/`)
on `app-shell` deriveRelatedLists, `RecordDetailView.harness`,
`ObjectSettingsPanel*`, `plugin-detail` synth and all of
`@object-ui/i18n`: 133 files / 2,389 tests passed. The whole app-shell +
plugin-detail suites ran past the local time limit and are left to CI.

Main merge conflicts and how they were resolved: `docs/adr/0035` keeps
both notes (this PR's 2026-11-20 amendment, then main's 2026-11-21
second-slice form note); `semantic/18` acceptance text carries both
qualifiers (the declared-`relatedLists` tab rule from this PR, the
same-place/tabbed-form wording from objectstack-ai#36009); Studio `en`/`zh` keep this
PR's tab-list wording and drop `highlightPreview` as objectstack-ai#36020 did;
`content/docs/references/{api/metadata,data/object,system/migration}.mdx`
and `liveness/state-counts/object.md` were regenerated, not hand-merged.

On 473c7ff, before this merge: `@objectstack/spec` test 2355 files
passed, `check:test-typecheck` and `check:generated` clean;
`@objectstack/lint` 868 files passed; `@objectstack/metadata-core` 222
files passed; `@object-ui/plugin-detail` 105 files passed;
`@object-ui/app-shell` 394 files passed; `@object-ui/i18n` 27 files
passed. Earlier runs:

- `pnpm --filter @objectstack/spec test` on the touched files;
`check:generated`; `check:liveness`.
- `pnpm --filter @objectstack/lint test` (validate-related-list-refs,
runtime-gate, rule-explanations).
- ui vitest (from `ui/`) on the touched plugin-detail / app-shell files:
7 files, 227 passed. A wide app-shell + plugin-detail run had no other
failures.
- Typecheck: spec, lint, plugin-detail and app-shell `type-check`.
- `dispatch-gates.mjs --commands` derived list (128 commands) run
locally: 126 green (two of them after building their inputs). Two are
prerequisite refusals that measure nothing here, left to CI:
`check-plugin-teardown-shape --self-test` (needs a full clone),
`check:dual-build-cjs-loads` (needs a whole-repo build). An ADR-0122
alias finding was fixed in da074fd.

## Fable L2 fixes (record 7071342837, at `0215fafa`)

- **M1** (`f5b256d4`): the object form's `relatedLists` row
(`packages/spec/src/data/object.form.ts`) now names a new
`related-list-entries` widget
(`ui/packages/app-shell/src/views/metadata-admin/widgets.tsx`, labelling
`control`). It renders a bare name and an object entry alike (the
entry's title and columns beside its name), keeps every entry's stored
form on add and remove, refuses a second entry for a name an object
entry already places, and removes the key with the last entry. The help
text states the tab-list meaning, hand-written in all ten translated
locales (`platform-objects` metadata-forms bundles), and the zh label is
记录页页签 in both the bundle and `metadata-form-zh-cn.ts`. Pinned by
`RelatedListEntriesWidget-35923.test.tsx` (the published row names the
widget; an object entry renders; remove/add keep it); the three
widget-registry tests (`widgetLabelling`,
`controlWidgetGridNaming-9889`, `controlWidgetFailureArmNaming-9931`)
carry the new key.
- **S1** (`f5b256d4`): `validate-related-list-refs` walks a dotted entry
column through `resolveFieldPath` from the child, as
`validate-object-field-refs` walks `relatedListColumns`; an unjudgeable
path stays unjudged. Test: `lead_id.name` passes, `lead_id.nope` and
`nope_id.name` are `related-list-column-unknown`. The spec `describe`
and the rule header say so.
- **S2** (`f5b256d4`): the `relatedLists` `describe` and jsdoc, the
ADR-0035 and ADR-0085 notes and the `related-lists-declared-is-tab-list`
migration entry state that a child list another package adds is hidden
too until the parent names it (accepted at build only when that package
is in the parent's stack), and that an extension package placing its own
list is objectstack-ai#35901. No lint hint added: the case has no stack-side signal to
warn on.
- `db548f41`: the four widget tests load `@objectstack/formula` and
`@objectstack/lint` at module top (`check-test-source-alias`:
`widgets.tsx` reaches both through dynamic imports).
- Changeset (`462477f8`): adds `@objectstack/platform-objects` (patch,
translations) and the three points above.
- Nits, under the small-things rule: **N1** left (one shape published as
a hand-written type beside the inferred one; deriving one from the other
needs the import cycle broken, a follow-up). **N2** left for the
approver as the accepted deviation the record names (names only,
`lookupColumns` precedent). **N3** left (first entry naming a list wins;
a lint advisory is a follow-up). **N4** left (no authorable parent has
an inbound FK from `sys_comment`).

## Human Minimum

Each item is one rule from
[CONTRIBUTING.md › Human
Minimum](https://github.com/objectstack-ai/objectstack/blob/main/CONTRIBUTING.md#human-minimum),
which links the AGENTS.md text that states it.

- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
(The new `related-list-entry.ts` holds only the name constants and two
pure name readers, like `related-list-body-table.ts`.)
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `pnpm lint` passes. (ESLint on every changed
file: 0 errors.)
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request. (Two cards folded by the dispatch order, one `Fixes` line
each.)
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset.
- [x] 6. `packages/spec` touched: its generated artifacts are
regenerated and committed.
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English. (Except the
maintainer's 维护者速读 block.)
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.

Tier H (`docs/adr/**`): the ADR-0085 and ADR-0035 notes need the
approver's review.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01L6bhgTgsPwrw3VbvRRcqth

<!-- signed: repo:objectstack#1 · os-sales ·
session_01L6bhgTgsPwrw3VbvRRcqth -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue protocol:data size/l tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

主从子表默认只是页签,不再自动放进概览和表单;只有字段分组指定时才放进去

3 participants